/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package calafie.builder.ihm.generated;

import java.util.HashMap;
import java.util.Map;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.text.DefaultCaret;

import calafie.builder.Builder;
import calafie.builder.Util;
import calafie.builder.ihm.controleur.ListenerButtonsFiche;
import calafie.builder.ihm.controleur.fiche.CaractNiveauListener;
import calafie.builder.ihm.controleur.fiche.CheckActionListener;
import calafie.builder.ihm.controleur.fiche.ComptNiveauListener;
import calafie.builder.ihm.controleur.fiche.FocusNoteListener;
import calafie.builder.ihm.controleur.fiche.FocusTextListener;
import calafie.builder.ihm.controleur.fiche.PVListener;
import calafie.builder.ihm.controleur.fiche.VocaListener;
import calafie.builder.ihm.controleur.fiche.VocaNiveauListener;
import calafie.builder.ihm.modele.ChoixVocation;
import calafie.builder.ihm.modele.ModeleFiche;
import calafie.builder.ihm.modele.swing.ModeleOrdreOngletFiche;
import calafie.builder.ihm.modele.type.CaractEnum;
import calafie.builder.ihm.modele.type.ComptEnum;
import calafie.builder.ihm.modele.type.TypeOrdre;
import calafie.builder.ihm.modele.type.TypeVocation;

/**
 * 
 * @author Dart
 */
public class FichePanBack extends JPanel implements AffichageFiche{

    /**
     * 
     */
    private static final long serialVersionUID = -6523266464569371062L;
    /**
     * Creates new form FichePanBack
     */
    public FichePanBack() {
        initComponents();
    }
    
    
    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    
    // <editor-fold defaultstate="collapsed"
    // desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panButton = new JPanel();
        buttonSave = new JButton();
        loadButton = new JButton();
        overViewButton = new JButton();
        exportButton = new JButton();
        panScroll = new JPanel();
        scrollPanOrdre = new JScrollPane();
        tableOrdre = new JTable();
        scrollPanOrdreV = new JScrollPane();
        tableOrdreV = new JTable();
        scrollNote = new JScrollPane();
        areaNote = new JTextArea();
        JPanel jPanel7 = new JPanel();
        JPanel jPanel2 = new JPanel();
        JLabel labelPseudo = new JLabel();
        fieldPseudo = new JTextField();
        JLabel labelPa = new JLabel();
        fieldPa = new JTextField();
        comboPv = new JComboBox();
        JLabel labelPV = new JLabel();
        panVocation = new JPanel();
        JLabel labelCarriere = new JLabel();
        comboVocCarriere = new JComboBox();
        comboVocCarriereNiveau = new JComboBox();
        comboVocTypeNiveau = new JComboBox();
        comboVocType = new JComboBox();
        JLabel labelType = new JLabel();
        JLabel labelPolitique = new JLabel();
        comboVocPolitiqueNiveau = new JComboBox();
        comboVocPolitique = new JComboBox();
        comboVocCombatNiveau = new JComboBox();
        comboVocCombat = new JComboBox();
        JLabel labelCombat = new JLabel();
        comboVocPouvoirNiveau = new JComboBox();
        JLabel labelPouvoir = new JLabel();
        comboVocPouvoir = new JComboBox();
        panCaract = new JPanel();
        comboFOR = new JComboBox();
        JLabel labelFOR = new JLabel();
        JLabel labelVOL = new JLabel();
        comboVOL = new JComboBox();
        JLabel labelCHA = new JLabel();
        comboCHA = new JComboBox();
        JLabel labelGES = new JLabel();
        comboGES = new JComboBox();
        JLabel labelINT = new JLabel();
        comboINT = new JComboBox();
        JLabel labelPER = new JLabel();
        comboPER = new JComboBox();
        panCompetence = new JPanel();
        comboCompBar = new JComboBox();
        comboCompCMN = new JComboBox();
        comboCompCC = new JComboBox();
        comboCompCD = new JComboBox();
        comboCompComm = new JComboBox();
        comboCompDem = new JComboBox();
        comboCompDis = new JComboBox();
        comboCompElo = new JComboBox();
        comboCompFal = new JComboBox();
        comboCompFoi = new JComboBox();
        comboCompInf = new JComboBox();
        comboCompMed = new JComboBox();
        comboCompObs = new JComboBox();
        comboCompOrga = new JComboBox();
        comboCompPou = new JComboBox();
        comboCompSed = new JComboBox();
        comboCompSur = new JComboBox();
        comboCompVol = new JComboBox();
        JLabel labelCompBaratin = new JLabel();
        JLabel labelCompCMN = new JLabel();
        JLabel labelCompCC = new JLabel();
        JLabel labelCompCD = new JLabel();
        JLabel labelCompCommerce = new JLabel();
        JLabel labelCompDem = new JLabel();
        JLabel labelCompDis = new JLabel();
        JLabel labelCompElo = new JLabel();
        JLabel labelCompFal = new JLabel();
        JLabel labelCompFoi = new JLabel();
        JLabel labelCompInfo = new JLabel();
        JLabel labelCompMed = new JLabel();
        JLabel labelCompObs = new JLabel();
        JLabel labelCompOrga = new JLabel();
        JLabel labelCompPou = new JLabel();
        JLabel labelCompSed = new JLabel();
        JLabel labelCompSur = new JLabel();
        JLabel labelCompVol = new JLabel();
        buttonReset = new JButton();
        areaNote.setLineWrap(true);        
        areaNote.setWrapStyleWord(true);

        
        fieldPa.setEditable(false);
        
        panButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        buttonSave.setText(Util.getMessage("builder.button.save"));
        loadButton.setText(Util.getMessage("builder.button.load"));
        exportButton.setText(Util.getMessage("builder.button.export"));
        buttonReset.setText(Util.getMessage("builder.button.reset"));
        overViewButton.setText(Util.getMessage("builder.button.overView"));
        
        
        buttonSave.addActionListener(ListenerButtonsFiche.getListenerSave());
        loadButton.addActionListener(ListenerButtonsFiche.getListenerLoad());
        exportButton.addActionListener(ListenerButtonsFiche.getListenerExport());
        buttonReset.addActionListener(ListenerButtonsFiche.getListenerReset());
        overViewButton.addActionListener(ListenerButtonsFiche.getListenerOverView());
        
        javax.swing.GroupLayout panButtonLayout = new javax.swing.GroupLayout(
                panButton);
        panButton.setLayout(panButtonLayout);
        panButtonLayout
                .setHorizontalGroup(panButtonLayout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                panButtonLayout
                                        .createSequentialGroup()
                                        .addComponent(buttonReset)
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(buttonSave)
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(loadButton)
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(overViewButton)
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(exportButton)
                                        .addContainerGap(
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)));
        panButtonLayout.setVerticalGroup(panButtonLayout.createParallelGroup(
                javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                panButtonLayout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(buttonReset)
                        .addComponent(buttonSave).addComponent(loadButton).addComponent(overViewButton)
                        .addComponent(exportButton)));

        ModeleOrdreOngletFiche model = ModeleOrdreOngletFiche.ajoutModele(tableOrdre);
        ModeleOrdreOngletFiche.ajoutModeleVocation(tableOrdreV);

        scrollPanOrdreV.setBorder(javax.swing.BorderFactory
                .createTitledBorder(Util.getMessage("builder.fiche.border.title.ordreVocation")));
        scrollPanOrdre.setBorder(javax.swing.BorderFactory
                .createTitledBorder(Util.getMessage("builder.fiche.border.title.ordre")));
        scrollNote.setBorder(javax.swing.BorderFactory
                .createTitledBorder(Util.getMessage("builder.fiche.border.title.notes")));

        scrollPanOrdre.setViewportView(tableOrdre);
        scrollPanOrdreV.setViewportView(tableOrdreV);

        areaNote.setColumns(20);
        areaNote.setRows(5);
        scrollNote.setViewportView(areaNote);

        JPanel panCheck = new JPanel();
        
        panCheck.add(CheckActionListener.addActionListener(new JCheckBox(), TypeOrdre.BATIMENTS, model));
        panCheck.add(CheckActionListener.addActionListener(new JCheckBox(), TypeOrdre.PERSONNAGE, model));
        panCheck.add(CheckActionListener.addActionListener(new JCheckBox(), TypeOrdre.RENCONTRES, model));
        panCheck.add(CheckActionListener.addActionListener(new JCheckBox(), TypeOrdre.ORGANISATIONS, model));
        panCheck.add(CheckActionListener.addActionListener(new JCheckBox(), TypeOrdre.PREROGATIVES, model));
        
        
        javax.swing.GroupLayout panScrollLayout = new javax.swing.GroupLayout(
                panScroll);
        panScroll.setLayout(panScrollLayout);
        panScrollLayout.setHorizontalGroup(panScrollLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(scrollPanOrdre)
                .addComponent(panCheck)
                .addGroup(
                        javax.swing.GroupLayout.Alignment.TRAILING,
                        panScrollLayout
                                .createSequentialGroup()
                                .addComponent(scrollPanOrdreV,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        611,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                .addComponent(scrollNote));
        panScrollLayout
                .setVerticalGroup(panScrollLayout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                panScrollLayout
                                        .createSequentialGroup()
                                        .addComponent(
                                                scrollPanOrdreV,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                185,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(2, 2, 2)
                                        .addComponent(panCheck)
                                        .addComponent(
                                                scrollPanOrdre,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                185,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(
                                                scrollNote,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                185,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addContainerGap(
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)));

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        labelPseudo.setText(Util.getMessage("builder.fiche.pseudo"));

        labelPa.setText(Util.getMessage("builder.fiche.nbPA"));
        
        labelPV.setText(Util.getMessage("builder.fiche.pdv"));

        fieldPa.setText("0");

        PVListener.addListenerNModel(comboPv);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(
                jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout
                .setHorizontalGroup(jPanel2Layout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                jPanel2Layout
                                        .createSequentialGroup()
                                        .addContainerGap(
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                        .addGroup(
                                                jPanel2Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                                
                                                        .addComponent(labelPa)
                                                        .addComponent(labelPV))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                jPanel2Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(
                                                                comboPv,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                fieldPa,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                40,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(144, 144, 144))
                        .addGroup(
                                jPanel2Layout
                                        .createSequentialGroup()
                                        .addContainerGap()
                                        .addComponent(labelPseudo)
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(fieldPseudo)
                                        .addContainerGap()));
        jPanel2Layout
                .setVerticalGroup(jPanel2Layout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                jPanel2Layout
                                        .createSequentialGroup()
                                        .addContainerGap(
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                        .addGroup(
                                                jPanel2Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                labelPseudo)
                                                        .addComponent(
                                                                fieldPseudo,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                jPanel2Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(labelPa)
                                                        .addComponent(
                                                                fieldPa,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                jPanel2Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboPv,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(labelPV))));

        panVocation.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        
        VocaListener.addListenerNModel(TypeVocation.CARRIERE, comboVocCarriere, this);
        VocaListener.addListenerNModel(TypeVocation.COMBAT, comboVocCombat, this);
        VocaListener.addListenerNModel(TypeVocation.POUVOIR, comboVocPouvoir, this);
        VocaListener.addListenerNModel(TypeVocation.TYPE, comboVocType, this);
        VocaListener.addListenerNModel(TypeVocation.POLITIQUE, comboVocPolitique, this);
        
        VocaNiveauListener.addListenerNModel(TypeVocation.CARRIERE, comboVocCarriereNiveau, this);
        VocaNiveauListener.addListenerNModel(TypeVocation.COMBAT, comboVocCombatNiveau, this);
        VocaNiveauListener.addListenerNModel(TypeVocation.POUVOIR, comboVocPouvoirNiveau, this);
        VocaNiveauListener.addListenerNModel(TypeVocation.TYPE, comboVocTypeNiveau, this);
        VocaNiveauListener.addListenerNModel(TypeVocation.POLITIQUE, comboVocPolitiqueNiveau, this);
        
        labelType.setText(TypeVocation.TYPE.getNom());
        labelPolitique.setText(TypeVocation.POLITIQUE.getNom());
        labelCombat.setText(TypeVocation.COMBAT.getNom());
        labelCarriere.setText(TypeVocation.CARRIERE.getNom());
        labelPouvoir.setText(TypeVocation.POUVOIR.getNom());


        javax.swing.GroupLayout panVocationLayout = new javax.swing.GroupLayout(
                panVocation);
        panVocation.setLayout(panVocationLayout);
        panVocationLayout
                .setHorizontalGroup(panVocationLayout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                panVocationLayout
                                        .createSequentialGroup()
                                        .addContainerGap()
                                        .addGroup(
                                                panVocationLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(
                                                                labelCarriere,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                labelType,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                labelPolitique,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                labelCombat,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                labelPouvoir,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panVocationLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                panVocationLayout
                                                                        .createSequentialGroup()
                                                                        .addComponent(
                                                                                comboVocCarriere,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                130,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(
                                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(
                                                                                comboVocCarriereNiveau,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                panVocationLayout
                                                                        .createSequentialGroup()
                                                                        .addComponent(
                                                                                comboVocType,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                130,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(
                                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(
                                                                                comboVocTypeNiveau,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                panVocationLayout
                                                                        .createSequentialGroup()
                                                                        .addComponent(
                                                                                comboVocPolitique,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                130,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(
                                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(
                                                                                comboVocPolitiqueNiveau,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                panVocationLayout
                                                                        .createSequentialGroup()
                                                                        .addComponent(
                                                                                comboVocCombat,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                130,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(
                                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(
                                                                                comboVocCombatNiveau,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                panVocationLayout
                                                                        .createSequentialGroup()
                                                                        .addComponent(
                                                                                comboVocPouvoir,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                130,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(
                                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(
                                                                                comboVocPouvoirNiveau,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)))));
        panVocationLayout
                .setVerticalGroup(panVocationLayout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                panVocationLayout
                                        .createSequentialGroup()
                                        .addGroup(
                                                panVocationLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                labelCarriere)
                                                        .addComponent(
                                                                comboVocCarriere,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboVocCarriereNiveau,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panVocationLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(labelType)
                                                        .addComponent(
                                                                comboVocType,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboVocTypeNiveau,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panVocationLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                labelPolitique)
                                                        .addComponent(
                                                                comboVocPolitique,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboVocPolitiqueNiveau,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panVocationLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                labelCombat)
                                                        .addComponent(
                                                                comboVocCombat,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboVocCombatNiveau,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panVocationLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                labelPouvoir)
                                                        .addComponent(
                                                                comboVocPouvoir,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboVocPouvoirNiveau,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))));

        panCaract.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        labelFOR.setText(CaractEnum.FOR.name());

        labelVOL.setText(CaractEnum.VOL.name());

        labelCHA.setText(CaractEnum.CHA.name());

        labelGES.setText(CaractEnum.GES.name());

        labelINT.setText(CaractEnum.INT.name());
        
        labelPER.setText(CaractEnum.PER.name());

        CaractNiveauListener.addListenerNModel(CaractEnum.FOR, comboFOR, this);
        CaractNiveauListener.addListenerNModel(CaractEnum.VOL, comboVOL, this);
        CaractNiveauListener.addListenerNModel(CaractEnum.CHA, comboCHA, this);
        CaractNiveauListener.addListenerNModel(CaractEnum.GES, comboGES, this);
        CaractNiveauListener.addListenerNModel(CaractEnum.INT, comboINT, this);
        CaractNiveauListener.addListenerNModel(CaractEnum.PER, comboPER, this);
  
        javax.swing.GroupLayout panCaractLayout = new javax.swing.GroupLayout(
                panCaract);
        panCaract.setLayout(panCaractLayout);
        panCaractLayout
                .setHorizontalGroup(panCaractLayout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                panCaractLayout
                                        .createSequentialGroup().addGap(10)
                                        .addGroup(
                                                panCaractLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                false)
                                                        .addComponent(
                                                                labelFOR,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                comboFOR,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                0,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCaractLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                false)
                                                        .addComponent(
                                                                labelVOL,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                comboVOL,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCaractLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                false)
                                                        .addComponent(
                                                                labelCHA,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                comboCHA,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCaractLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                false)
                                                        .addComponent(
                                                                labelGES,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                comboGES,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCaractLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                false)
                                                        .addComponent(
                                                                labelINT,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                comboINT,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCaractLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                false)
                                                        .addComponent(
                                                                labelPER,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                comboPER,
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addContainerGap(
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)));
        panCaractLayout.setVerticalGroup(panCaractLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

        .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                panCaractLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

                        .addGroup(
                                panCaractLayout
                                        .createSequentialGroup()
                                        .addComponent(labelPER)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboPER, javax.swing.GroupLayout.PREFERRED_SIZE, 15,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(
                                panCaractLayout
                                        .createSequentialGroup()
                                        .addComponent(labelFOR)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboFOR, javax.swing.GroupLayout.PREFERRED_SIZE, 15,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))

                        .addGroup(
                                panCaractLayout
                                        .createSequentialGroup()
                                        .addComponent(labelVOL)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboVOL, javax.swing.GroupLayout.PREFERRED_SIZE, 15,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))

                        .addGroup(
                                panCaractLayout
                                        .createSequentialGroup()
                                        .addComponent(labelCHA)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboCHA, javax.swing.GroupLayout.PREFERRED_SIZE, 15,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(
                                panCaractLayout
                                        .createSequentialGroup()
                                        .addComponent(labelGES)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboGES, javax.swing.GroupLayout.PREFERRED_SIZE, 15,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(
                                panCaractLayout
                                        .createSequentialGroup()
                                        .addComponent(labelINT)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboINT, javax.swing.GroupLayout.PREFERRED_SIZE, 15,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))

        ));

        panCompetence.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        ComptNiveauListener.addListenerNModel(ComptEnum.BARATIN, comboCompBar, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.COMBAT_MN, comboCompCMN, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.COMBAT_CT, comboCompCC, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.COMBAT_DI, comboCompCD, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.COMMERCE, comboCompComm, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.DEMOLITION, comboCompDem, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.DISCRETION, comboCompDis, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.ELOQUENCE, comboCompElo, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.FALSIFICATION, comboCompFal, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.FOI, comboCompFoi, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.INFORMATIQUE, comboCompInf, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.MEDECINE, comboCompMed, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.OBSERVATION, comboCompObs, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.ORGANISATION, comboCompOrga, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.POUVOIR, comboCompPou, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.SEDUCTION, comboCompSed, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.SURVIE, comboCompSur, this);
        ComptNiveauListener.addListenerNModel(ComptEnum.VOL, comboCompVol, this);

        labelCompBaratin.setText(ComptEnum.BARATIN.getNom());

        labelCompCMN.setText(ComptEnum.COMBAT_MN.getNom());

        labelCompCC.setText(ComptEnum.COMBAT_CT.getNom());

        labelCompCD.setText(ComptEnum.COMBAT_DI.getNom());

        labelCompCommerce.setText(ComptEnum.COMMERCE.getNom());

        labelCompDem.setText(ComptEnum.DEMOLITION.getNom());

        labelCompDis.setText(ComptEnum.DISCRETION.getNom());

        labelCompElo.setText(ComptEnum.ELOQUENCE.getNom());

        labelCompFal.setText(ComptEnum.FALSIFICATION.getNom());

        labelCompFoi.setText(ComptEnum.FOI.getNom());

        labelCompInfo.setText(ComptEnum.INFORMATIQUE.getNom());

        labelCompMed.setText(ComptEnum.MEDECINE.getNom());

        labelCompObs.setText(ComptEnum.OBSERVATION.getNom());

        labelCompOrga.setText(ComptEnum.ORGANISATION.getNom());

        labelCompPou.setText(ComptEnum.POUVOIR.getNom());

        labelCompSed.setText(ComptEnum.SEDUCTION.getNom());

        labelCompSur.setText(ComptEnum.SURVIE.getNom());

        labelCompVol.setText(ComptEnum.VOL.getNom());

        javax.swing.GroupLayout panCompetenceLayout = new javax.swing.GroupLayout(
                panCompetence);
        panCompetence.setLayout(panCompetenceLayout);
        panCompetenceLayout
                .setHorizontalGroup(panCompetenceLayout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                panCompetenceLayout
                                        .createSequentialGroup()
                                        .addContainerGap()
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(
                                                                labelCompBaratin)
                                                        .addComponent(
                                                                labelCompCMN)
                                                        .addComponent(
                                                                labelCompCC)
                                                        .addComponent(
                                                                labelCompCD)
                                                        .addComponent(
                                                                labelCompCommerce)
                                                        .addComponent(
                                                                labelCompDem)
                                                        .addComponent(
                                                                labelCompDis)
                                                        .addComponent(
                                                                labelCompElo)
                                                        .addComponent(
                                                                labelCompFal)
                                                        .addComponent(
                                                                labelCompFoi)
                                                        .addComponent(
                                                                labelCompInfo)
                                                        .addComponent(
                                                                labelCompMed)
                                                        .addComponent(
                                                                labelCompObs)
                                                        .addComponent(
                                                                labelCompOrga)
                                                        .addComponent(
                                                                labelCompPou)
                                                        .addComponent(
                                                                labelCompSed)
                                                        .addComponent(
                                                                labelCompSur)
                                                        .addComponent(
                                                                labelCompVol))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                15, Short.MAX_VALUE)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(
                                                                comboCompBar,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompCMN,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompCC,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompCD,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompComm,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompDem,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompDis,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompElo,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompFal,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompFoi,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompInf,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompMed,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompObs,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompOrga,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompPou,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompSed,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompSur,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                comboCompVol,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addContainerGap()));
        panCompetenceLayout
                .setVerticalGroup(panCompetenceLayout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                panCompetenceLayout
                                        .createSequentialGroup()
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompBar,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompBaratin,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompCMN,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompCMN,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompCC,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompCC,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompCD,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompCD,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompComm,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompCommerce,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompDem,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompDem,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompDis,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompDis,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompElo,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompElo,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompFal,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompFal,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompFoi,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompFoi,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompInf,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompInfo,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompMed,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompMed,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompObs,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompObs,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompOrga,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompOrga,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompPou,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompPou,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompSed,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompSed,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompSur,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompSur,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(
                                                panCompetenceLayout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(
                                                                comboCompVol,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                labelCompVol,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))));

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(
                jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout
                .setHorizontalGroup(jPanel7Layout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                jPanel7Layout
                                        .createSequentialGroup()
                                        .addGroup(
                                                jPanel7Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                false)
                                                        .addComponent(
                                                                jPanel2,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(
                                                                panCaract,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                panCompetence,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(
                                                                panVocation,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE))
                                        .addContainerGap(
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)));
        jPanel7Layout
                .setVerticalGroup(jPanel7Layout
                        .createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(
                                jPanel7Layout
                                        .createSequentialGroup()
                                        .addComponent(
                                                jPanel2,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(
                                                panVocation,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(
                                                panCaract,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(
                                                panCompetence,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addContainerGap(
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(
                        layout.createSequentialGroup()
                                .addComponent(jPanel7,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(
                                        layout.createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(
                                                        panScroll,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(
                                                        panButton,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                ));
        layout.setVerticalGroup(layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(
                        layout.createSequentialGroup()
                                .addGroup(
                                        layout.createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                false)
                                                .addComponent(
                                                        jPanel7,
                                                        javax.swing.GroupLayout.Alignment.LEADING,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        Short.MAX_VALUE)
                                                .addGroup(
                                                        javax.swing.GroupLayout.Alignment.LEADING,
                                                        layout.createSequentialGroup()
                                                                .addComponent(
                                                                        panScroll,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(
                                                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(
                                                                        panButton,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                                ));
       
        
        FocusNoteListener.addListener(areaNote);
        FocusTextListener.addListener(fieldPseudo);
        
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea areaNote;
    private javax.swing.JButton buttonSave;
    private JButton buttonReset;
    private javax.swing.JComboBox comboCHA;
    private javax.swing.JComboBox comboCompBar;
    private javax.swing.JComboBox comboCompCC;
    private javax.swing.JComboBox comboCompCD;
    private javax.swing.JComboBox comboCompCMN;
    private javax.swing.JComboBox comboCompComm;
    private javax.swing.JComboBox comboCompDem;
    private javax.swing.JComboBox comboCompDis;
    private javax.swing.JComboBox comboCompElo;
    private javax.swing.JComboBox comboCompFal;
    private javax.swing.JComboBox comboCompFoi;
    private javax.swing.JComboBox comboCompInf;
    private javax.swing.JComboBox comboCompMed;
    private javax.swing.JComboBox comboCompObs;
    private javax.swing.JComboBox comboCompOrga;
    private javax.swing.JComboBox comboCompPou;
    private javax.swing.JComboBox comboCompSed;
    private javax.swing.JComboBox comboCompSur;
    private javax.swing.JComboBox comboCompVol;
    private javax.swing.JComboBox comboFOR;
    private javax.swing.JComboBox comboGES;
    private javax.swing.JComboBox comboINT;
    private javax.swing.JComboBox comboPER;
    private javax.swing.JComboBox comboPv;
    private javax.swing.JComboBox comboVOL;
    private javax.swing.JComboBox comboVocCarriere;
    private javax.swing.JComboBox comboVocCarriereNiveau;
    private javax.swing.JComboBox comboVocCombat;
    private javax.swing.JComboBox comboVocCombatNiveau;
    private javax.swing.JComboBox comboVocPolitique;
    private javax.swing.JComboBox comboVocPolitiqueNiveau;
    private javax.swing.JComboBox comboVocPouvoir;
    private javax.swing.JComboBox comboVocPouvoirNiveau;
    private javax.swing.JComboBox comboVocType;
    private javax.swing.JComboBox comboVocTypeNiveau;
    private javax.swing.JButton exportButton;
    private javax.swing.JTextField fieldPa;
    private javax.swing.JTextField fieldPseudo;

    private javax.swing.JButton loadButton;
    private javax.swing.JButton overViewButton;
    private JPanel panButton;
    private JPanel panCaract;
    private JPanel panCompetence;
    private JPanel panScroll;
    private JPanel panVocation;
    private javax.swing.JScrollPane scrollNote;
    private javax.swing.JScrollPane scrollPanOrdre;
    private javax.swing.JScrollPane scrollPanOrdreV;
    private javax.swing.JTable tableOrdre;
    private javax.swing.JTable tableOrdreV;
    // End of variables declaration//GEN-END:variables
    
    
    
    public void register(CaractEnum ref, JComboBox combo) {
        mapCaract.put(ref, combo);
    }

    
    public void register(ComptEnum ref, JComboBox combo) {
        mapCompt.put(ref, combo);
    }

   
    public void register(TypeVocation ref, JComboBox combo) {
        mapVocations.put(ref, combo);
    }

   
    public void registerNiveau(TypeVocation ref, JComboBox combo) {
        mapNiveauVocations.put(ref, combo);
    }

    
    public void setPA(int value) {
        this.fieldPa.setText(Integer.toString(value));
    }

    private Map<TypeVocation, JComboBox> mapNiveauVocations = new HashMap<TypeVocation, JComboBox>();
    private Map<TypeVocation, JComboBox> mapVocations = new HashMap<TypeVocation, JComboBox>();
    private Map<ComptEnum, JComboBox> mapCompt = new HashMap<ComptEnum, JComboBox>();
    private Map<CaractEnum, JComboBox> mapCaract = new HashMap<CaractEnum, JComboBox>();
    
        
    public void charger(ModeleFiche fiche) {
        fieldPseudo.setText(fiche.getPseudo());
        
        DefaultCaret caret = (DefaultCaret) areaNote.getCaret();
        caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
        areaNote.setText(fiche.getNote());
        caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
        
        comboPv.setSelectedItem(Integer.toString(fiche.getPV()));
        
        
        for (CaractEnum caract : CaractEnum.values()) {
            mapCaract.get(caract).setSelectedItem(fiche.getCaracteristiques().get(caract).getValeur());
        }

        for (ComptEnum compt : ComptEnum.values()) {
            mapCompt.get(compt).setSelectedItem(fiche.getCompetences().get(compt).getValeur());
        }

        for (TypeVocation type : TypeVocation.values()) {
            ChoixVocation choix = fiche.getVocations().get(type);
            // Pourquoi on va chercher la vocation directement ?
            // parce que pour savoir quel valeur on met on fait un equal sur un getElementAt (du model)
            // et comme dans le model on stoke les objets vocation, si on veut sélectionner la bonne valeur
            // nous faut la vocation.
            mapVocations.get(type).setSelectedItem(Builder.getInstance().getBiblio().getVocation(type, choix.getNom()));
            mapNiveauVocations.get(type).setSelectedIndex(choix.getValeur());
            mapVocations.get(type).repaint();
        }
        
        
    }

}
